home *** CD-ROM | disk | FTP | other *** search
/ Apple Reference & Presen… 1994 February Supplement / ARPL-Feb-94-Supplement-PowerPC.iso / 3rd Party PowerPC Demo Apps / Aldus FreeHand / Aldus FreeHand 4.0 TV / Aldus FreeHand 4.0 TV.rsrc / Post_1068 < prev    next >
Encoding:
Text File  |  1994-01-25  |  2.4 KB  |  154 lines

  1. /makepattern defed /xt xdf
  2. xt not {/yt save def} if
  3. userdict begin /fhpatdict 12 dict def end
  4. fhpatdict begin
  5.  /PatternType 1 def
  6.  /PaintType 1 def 
  7.  /TilingType 1 def
  8.  /BBox [0 0 8 8] def
  9.  /XStep 8 def
  10.  /YStep 8 def
  11.  /PatMtx [1 0 0 -1 0 8] def
  12.  /PatIMtx [1 0 0 1 0 0] def
  13. /PaintProc
  14. {begin FHPatColor vc 8 8 true PatMtx PatData imagemask end} bdf
  15.  /FHPatColor [0 0 0 0] def
  16.  
  17.  
  18. end
  19. /macpatorient{1 0 dtransform 0 eq exch 0 ne and}bdf
  20. /veccalc { dtransform round exch round exch idtransform dup mul exch dup mul exch add sqrt } bdf
  21. gsave 
  22. macpatorient 
  23. initmatrix
  24. 0 0 transform 
  25. 2 copy 
  26. round exch round exch
  27. 2 index sub exch 3 index sub exch
  28. idtransform translate
  29. pop pop
  30. 1 0 veccalc 0 1 veccalc 
  31. scale
  32. {0}{-90}ifelse
  33. rotate
  34. matrix currentmatrix
  35. /PATmtx xdf
  36. grestore
  37. /pF{
  38.  gsave 1 setgray filler grestore
  39.  fhpatdict begin  
  40.  /PatData xdf  
  41.  /FHPatColor xdf  
  42.  end
  43.  save    
  44.  PATmtx setmatrix 
  45.  fhpatdict dup   
  46.  /PatIMtx get   
  47.  PATmp     
  48.  PATsp     
  49.  /clipper load /eoclip load eq PATfill
  50.  restore
  51. }bdf
  52. /pS{
  53.  fhpatdict begin  
  54.  /PatData xdf  
  55.  /FHPatColor xdf  
  56.  end
  57.  save
  58.  PATprestroke    
  59.  PATmtx setmatrix
  60.  gsave 1 setgray stroke grestore
  61.  fhpatdict dup 
  62.  /PatIMtx get 
  63.  PATmp 
  64.  PATsp 
  65.  PATstroke
  66.  restore
  67. }bdf
  68. xt not {yt restore} if
  69. xt {/yt save def} if
  70. /macpatstring 8 string def
  71. /macpattint 0 def
  72. /macpatcol [] def
  73. /macpatangle{1 0 matrix defaultmatrix dtransform exch atan}bdf
  74. /macpatorient{1 0 dtransform 0 eq exch 0 ne and}bdf
  75. /macpatcountbits 
  76. {
  77.  0 exch     
  78.  {
  79. cvi 
  80. 0 1 8 
  81. pop
  82. dup 1 and 
  83. 0 ne 
  84. {
  85. exch 
  86. 1 add 
  87. exch 
  88. } if
  89. -1 bitshift 
  90. } for
  91. pop 
  92.  }
  93.  forall
  94. }bdf
  95. /macpatset
  96. {
  97.  macpatstring copy pop 
  98.  9.375 
  99.  macpatangle 
  100.  macpatorient not{-90 add}if
  101.  {
  102. 1 add 4 mul cvi macpatstring exch get exch
  103. 1 add 4 mul cvi 7 sub bitshift 1 and 
  104. inverted? {1 exch sub} if
  105.  }
  106.  setscreen
  107.  
  108.  64 macpatstring macpatcountbits sub 64 div
  109.  inverted? {.9921875 exch sub} if
  110.  /macpattint xdf
  111.  
  112.  
  113.  {} st
  114.  fhnumcolors 1 ne
  115.  {
  116. cvc dup length array copy /macpatcol xdf 
  117. /macpattint 1 macpattint sub def 
  118. macpatcol length 4 eq
  119. {
  120. 0 1 3
  121. {
  122. macpatcol exch 2 copy
  123. get .25 lt{0}{macpattint}ifelse put
  124. }for
  125. }
  126. {
  127. macpatcol dup 0 get .25 lt{0}{macpattint}ifelse 0 exch put
  128. }ifelse 
  129. macpatcol vc
  130.  }
  131.  {
  132. currentgray 1 ne {macpattint setseparationgray} if
  133.  } 
  134.  ifelse
  135. }bdf
  136. /pF{
  137.  gsave 
  138.  exch vc
  139.  macpatset 
  140.  {filler}fp 
  141.  grestore
  142. }bdf
  143. /pS{
  144.  gsave 
  145.  exch vc
  146.  macpatset 
  147.  {stroke}fp 
  148.  grestore
  149. }bdf
  150. xt {yt restore} if
  151. /pf{closepath pF}bdf
  152. /ps{closepath pS}bdf